package com.example.xksys.controller;

import com.example.xksys.service.StudentService;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;
import java.util.Map;

//返回的是数据，不在是页面名称了
@RestController
@RequestMapping("/student")
public class StudentController {
    @Resource
    private StudentService studentService;
    @RequestMapping("/reg")
    public int reg(@RequestParam Map<String,String> param){
        System.out.println(param+"111");
        return studentService.doSave(param);
    }
    @RequestMapping("/segsearch")
    public List<Map<String, Object> > segsearch(@RequestParam Map<String,String> param){
        System.out.println(param+"222");
        System.out.println(studentService.doregsearch(param));
        return studentService.doregsearch(param);
    }
    @RequestMapping("/login")
    public List<Map<String,Object> > login(@RequestParam Map<String,String> param){
        return studentService.login(param);
    }

    @RequestMapping("/checkPwd")
    public List<Map<String,Object> > checkPwd(@RequestParam Map<String,String> param){
//        System.out.println(studentService.doregsearch(param));
        return studentService.doCheckPwd(param);
    }
    @RequestMapping("/updatePwd")
    public int updatePwd(@RequestParam Map<String,String> param){
        return studentService.doUpdatePwd(param);
    }
}
